package homework;

import java.util.Scanner;

public class HomeWork5 {
    public static void find(int[]arr,int k){
        int l=0;
        int r=arr.length-1;
        while (l<=r){
            int mid=(l+r)/2;
            if(k>arr[mid]){
                l=mid+1;
            }else if(k<arr[mid]){
                r=mid-1;
            }else {
                System.out.println("找到了");
                return;
            }
        }
        System.out.println("没找到");
        return;
    }
    public static boolean judge(int[] arr){
        int i=0;
        int j=1;
        while (j<arr.length){
            if(arr[i]<arr[j]){
                i++;
                j++;
            }else {
                return false;
            }
        }
        return true;
    }
    public static void sort(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            boolean k=false;
            for (int j = 0; j < arr.length-i-1; j++) {
                if(arr[j]>arr[j+1]){
                    int tmp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=tmp;
                    k=true;
                }
            }
            if(k){
                return;
            }
        }
    }
    public static void find_appear(int[]arr){
        int k=0;
        for (int i:arr) {
         k^=i;
        }
        System.out.println(k);
    }
    public static void main(String[] args) {
        int[]arr={2,2,50,7,6,7,6};
//        Scanner scanner=new Scanner(System.in);
//        int k=scanner.nextInt();
//        find(arr,k);
        find_appear(arr);


    }
}
